<?php

namespace App\Containers\AppSection\Confirmation\UI\API\Transformers;

use App\Containers\AppSection\Confirmation\Models\Confirmation;
use App\Ship\Parents\Transformers\Transformer;

class ConfirmationTransformer extends Transformer
{
    protected array $defaultIncludes = [

    ];

    /**
     * @var  array
     */
    protected array $availableIncludes = [

    ];

    public function transform(Confirmation $t): array
    {
        return [
            'object' => $t->getResourceKey(),
            'include' => $this->getAvailableIncludes(),
            'id' => $t->getHashedKey(),
            'request_type' => $t->request_type,
            'confirm_type' => $t->confirm_type,
            'code' => $t->code,
            'value' => $t->value,
            'created_at' => $this->dateTimeFormatter($t->created_at),
            'updated_at' => $this->dateTimeFormatter($t->updated_at),
            'readable_created_at' => $t->created_at->diffForHumans(),
            'readable_updated_at' => $t->updated_at->diffForHumans()
        ];
    }
}
